﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using QuocTeViet.BL;
using QuocTeViet.DO;

namespace QuocTeViet.Module
{
    public partial class ucLamDep2 : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            cmsArticleDO obj = new cmsArticleBL().SelectTopTin();
            rpt.DataSource = new cmsArticleBL().SelectArticleHome(obj.ArticleID);
            rpt.DataBind();
            if (Session["lang"].ToString() == "VN")
            {
                hplink.NavigateUrl = "/Article/" + obj.ArticleID + "/" + FriendlyUrl(obj.Title);
                hplink2.NavigateUrl = "/Article/" + obj.ArticleID + "/" + FriendlyUrl(obj.Title);
                imgTT.ImageUrl = "/Media/" + obj.ImageUrl;
                imgTT.AlternateText = obj.Title;
                lbDescription.Text = obj.Description;
                lbTitle.Text = obj.Title;
            }
            else
            {
                hplink.NavigateUrl = "/Article/" + obj.ArticleID + "/" + FriendlyUrl(obj.eTitle);
                hplink2.NavigateUrl = "/Article/" + obj.ArticleID + "/" + FriendlyUrl(obj.eTitle);
                imgTT.ImageUrl = "/Media/" + obj.ImageUrl;
                imgTT.AlternateText = obj.eTitle;
                lbDescription.Text = obj.eDescription;
                lbTitle.Text = obj.eTitle;
            }
        }
        protected string FriendlyUrl(string strTitle)
        {
            return Ultility.Change_AV(strTitle);
        }
    }
}